﻿using AutoMapper;
using Lemon.Blog.Account.Dtos;
using Lemon.Blog.Blog;
using Lemon.Blog.Blog.Dtos;
using Lemon.Blog.Users;

namespace Lemon.Blog
{
    public class BlogApplicationAutoMapperProfile : Profile
    {
        public BlogApplicationAutoMapperProfile()
        {
            /* You can configure your AutoMapper mapping configuration here.
             * Alternatively, you can split your mapping configurations
             * into multiple profile classes for a better organization. */
            CreateMap<BlogDto, Blog.Blog>(MemberList.None);
            CreateMap<BlogReplyDto, BlogReply>();
            CreateMap<BlogReply, BlogReplyResultDto>()
                .ForMember(d => d.BlogReplyId, o => o.MapFrom(s => s.Id));
            CreateMap<Blog.Blog, BlogResultDto>();
            CreateMap<AppUser, UserInfoDto>();
        }
    }
}
